home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Libraries / GUSI / Examples / GUSIFinger.c < prev    next >
C/C++ Source or Header  |  1993-09-19  |  1KB  |  46 lines

  1. /*********************************************************************
  2. Project    :    GUSI                -    Grand Unified Socket Interface
  3. File        :    GUSIFinger.c    -    finger daemon
  4. Author    :    Matthias Neeracher
  5. Started    :    07Feb93                                Language    :    MPW C
  6. Modified    :    07Feb93    MN    
  7. Last        :    07Feb93
  8. *********************************************************************/
  9.  
  10. #include <stdio.h>
  11. #include <Resources.h>
  12. #include <Processes.h>
  13. #include <Memory.h>
  14. #include <QuickDraw.h>
  15. #include <Fonts.h>
  16. #include <Windows.h>
  17.  
  18. void main()
  19. {
  20.     Handle    macName;
  21.     Handle    whoName;
  22.     
  23.     long    secs;
  24.     long    mins;
  25.     long    hour;
  26.     
  27.     InitGraf(&qd.thePort);
  28.     
  29.     macName = GetResource('STR ', -16413);
  30.     HLock(macName);
  31.     whoName = GetResource('STR ', -16096);
  32.     HLock(whoName);
  33.  
  34.     secs = TickCount() / 60;
  35.     mins = secs / 60;
  36.     hour = mins / 60;
  37.     
  38.     secs = secs - mins * 60;
  39.     mins = mins - hour * 60;
  40.     
  41.     printf("Macintosh belongs to:\t%P\r", *whoName);
  42.     printf("Macintosh is named:\t%P\r", *macName);
  43.     printf("Has been up for:\t%02d:%02d:%02d\r", hour, mins, secs);
  44. }
  45.  
  46.